﻿using Company.Hardware.Base.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Company.Hardware.Base
{
    /// <summary>
    /// 解码器接口
    /// </summary>
    public interface IDecoder
    {
        event Action<string>? OnNotify;
        event Action<HL7>? OnUpload;

        /// <summary>
        /// 初始化解码器
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        Task<bool> InitAsync(Config config);

        /// <summary>
        /// 上传数据
        /// </summary>
        /// <param name="uploader">上传服务类</param>
        /// <returns></returns>
        Task<bool> StartAsync(IUploader uploader);

        /// <summary>
        /// 停止工作
        /// </summary>
        /// <returns></returns>
        bool Stop();
    }
}
